<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <ul id="list">
        <li>传智播客</li>
        <li>黑马程序员</li>
        <li>博学谷</li>
    </ul>

    <input type="text" id="tx">
    <input type="button" value="动态生成列表项" name="" id="btn">

    <script>
        let btn = document.getElementById("btn");
        btn.onclick = function () {
            let tx = document.getElementById("tx");
            let txvalue = tx.value;
            tx.value = '';
            document.getElementById("list").innerHTML +="<li>"+txvalue+"</li>";
        }
    </script>
</body>

</html>